package org.boyan.interceptor;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: zhuxiaobao
 * @time: 2021/9/24 16:05
 */

@Configuration("onlineConfiguration")
public class OnlineConfiguration implements WebMvcConfigurer {
    @Bean
    public a onlineInterceptor() {
        return new a();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        String[] arrayOfString = { "/*.html", "/html/**", "/js/**", "/css/**", "/images/**" };
        registry.addInterceptor(onlineInterceptor()).excludePathPatterns(arrayOfString).addPathPatterns("/online/cgform/api/**");
    }
}
